home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Think C dcmd 1.0.1 ƒ / Think Put Lib source / PutPStrTo.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-31  |  412 b   |  21 lines  |  [TEXT/KAHL]

  1.     extern    unsigned char    __putBuffer[256];
  2.     extern    short            __putMark;
  3.  
  4. void PutChar(char c);
  5. void PutSpacesTo(int endpos);
  6.  
  7. void PutPStrTo(const unsigned char* s, int endpos)
  8. {
  9.         int    i;
  10.  
  11.     if ( endpos > __putMark )
  12.     {
  13.         for ( i=1; i<= s[0] && __putMark<endpos; i++ )
  14.             PutChar( s[i] );
  15.             
  16.         if ( i<= s[0] )
  17.             __putBuffer[__putMark] = '…';
  18.         else
  19.             PutSpacesTo( endpos );        /* pads with spaces if necessary */
  20.     }
  21. }